package com.heima.wemedia.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.entity.WmUser;
import com.heima.wemedia.service.WmUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 自媒体用户控制层
 */
@RestController
@RequestMapping("/api/v1/user")
public class WmUserController {

    @Autowired
    private WmUserService wmUserService;

    @PostMapping("/save")
    public ResponseResult save(@RequestBody WmUser wmUser) {
        wmUser.setType(0);
        int i=10/0;
        wmUserService.insert(wmUser);
        return ResponseResult.okResult(wmUser);
    }
}

